package com.study.feign.feign;

import com.study.feign.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 通过 feign 调用 eureka-client-test 服务
 *
 * @author huang
 */
@FeignClient("eureka-client-test")// 需要调用的服务名
public interface EurekaClientTestFeign {

    /**
     * 需要调用的方法, 可以直接拷贝过来, 改成接口即可
     */
    @GetMapping("/testClient/get")
    String get();

    /**
     * 带参数
     */
    @PostMapping("/testClient/post/{gender}")
    String post(@PathVariable String gender, @RequestBody User user);
}
